home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Fonts.h
-
- Contains: Font Manager Interfaces.
-
- Version: Technology: System 7.5
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
- #ifndef __FONTS__
- #define __FONTS__
-
- #ifndef __GXTYPES__
- #include <GXTypes.h>
- #endif
- #ifndef __QUICKDRAW__
- #include <Quickdraw.h>
- #endif
- #ifndef __TEXTCOMMON__
- #include <TextCommon.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
-
- enum {
- systemFont = 0,
- applFont = 1,
- newYork = 2,
- geneva = 3,
- monaco = 4,
- venice = 5,
- london = 6,
- athens = 7,
- sanFran = 8,
- toronto = 9,
- cairo = 11,
- losAngeles = 12,
- times = 20,
- helvetica = 21,
- courier = 22,
- symbol = 23,
- mobile = 24,
- commandMark = 17,
- checkMark = 18,
- diamondMark = 19
- };
-
-
- enum {
- appleMark = 20,
- propFont = 36864L,
- prpFntH = 36865L,
- prpFntW = 36866L,
- prpFntHW = 36867L,
- fixedFont = 45056L,
- fxdFntH = 45057L,
- fxdFntW = 45058L,
- fxdFntHW = 45059L,
- fontWid = 44208L
- };
-
- struct FMInput {
- short family;
- short size;
- Style face;
- Boolean needBits;
- short device;
- Point numer;
- Point denom;
- };
- typedef struct FMInput FMInput;
-
- /*
- #pragma output c
- typedef struct OpaquePrivateFontResult *privateFontResult;
- #pragma output pascal
- typedef Ptr privateFontResult;
- #pragma output all
- */
- typedef struct OpaqueFontResult* FontResult;
- struct FMOutput {
- short errNum;
- FontResult fontResult;
- UInt8 boldPixels;
- UInt8 italicPixels;
- UInt8 ulOffset;
- UInt8 ulShadow;
- UInt8 ulThick;
- UInt8 shadowPixels;
- SInt8 extra;
- UInt8 ascent;
- UInt8 descent;
- UInt8 widMax;
- SInt8 leading;
- SInt8 curStyle;
- Point numer;
- Point denom;
- };
- typedef struct FMOutput FMOutput;
-
- typedef FMOutput *FMOutPtr;
- typedef FMOutput *FMOutputPtr;
- struct FontRec {
- short fontType; /*font type*/
- short firstChar; /*ASCII code of first character*/
- short lastChar; /*ASCII code of last character*/
- short widMax; /*maximum character width*/
- short kernMax; /*negative of maximum character kern*/
- short nDescent; /*negative of descent*/
- short fRectWidth; /*width of font rectangle*/
- short fRectHeight; /*height of font rectangle*/
- unsigned short owTLoc; /*offset to offset/width table*/
- short ascent; /*ascent*/
- short descent; /*descent*/
- short leading; /*leading*/
- short rowWords; /*row width of bit image / 2 */
- };
- typedef struct FontRec FontRec;
-
- typedef FontRec *FontRecPtr;
- struct FMetricRec {
- Fixed ascent; /*base line to top*/
- Fixed descent; /*base line to bottom*/
- Fixed leading; /*leading between lines*/
- Fixed widMax; /*maximum character width*/
- Handle wTabHandle; /*handle to font width table*/
- };
- typedef struct FMetricRec FMetricRec;
-
- /*
- typedef struct FMetricRec FMetricRec, *FMetricRecPtr;
- typedef FMetricRecPtr *FMetricRecHandle;
- */
- typedef FMetricRec *FMetricRecPtr;
- typedef FMetricRecPtr *FMetricRecHandle;
- struct WidEntry {
- short widStyle; /*style entry applies to*/
- };
- typedef struct WidEntry WidEntry;
-
- struct WidTable {
- short numWidths; /*number of entries - 1*/
- };
- typedef struct WidTable WidTable;
-
- struct AsscEntry {
- short fontSize;
- short fontStyle;
- short fontID; /*font resource ID*/
- };
- typedef struct AsscEntry AsscEntry;
-
- struct FontAssoc {
- short numAssoc; /*number of entries - 1*/
- };
- typedef struct FontAssoc FontAssoc;
-
- struct StyleTable {
- short fontClass;
- long offset;
- long reserved;
- char indexes[48];
- };
- typedef struct StyleTable StyleTable;
-
- struct NameTable {
- short stringCount;
- Str255 baseFontName;
- };
- typedef struct NameTable NameTable;
-
- struct KernPair {
- char kernFirst; /*1st character of kerned pair*/
- char kernSecond; /*2nd character of kerned pair*/
- short kernWidth; /*kerning in 1pt fixed format*/
- };
- typedef struct KernPair KernPair;
-
- struct KernEntry {
- short kernStyle; /*style the entry applies to*/
- short kernLength; /*length of this entry*/
- };
- typedef struct KernEntry KernEntry;
-
- struct KernTable {
- short numKerns; /*number of kerning entries*/
- };
- typedef struct KernTable KernTable;
-
- struct WidthTable {
- Fixed tabData[256]; /*character widths*/
- FontResult fontResult; /*font record used to build table*/
- long sExtra; /*space extra used for table*/
- long style; /*extra due to style*/
- short fID; /*font family ID*/
- short fSize; /*font size request*/
- short face; /*style (face) request*/
- short device; /*device requested*/
- Point inNumer; /*scale factors requested*/
- Point inDenom; /*scale factors requested*/
- short aFID; /*actual font family ID for table*/
- Handle fHand; /*family record used to build up table*/
- Boolean usedFam; /*used fixed point family widths*/
- UInt8 aFace; /*actual face produced*/
- short vOutput; /*vertical scale output value*/
- short hOutput; /*horizontal scale output value*/
- short vFactor; /*vertical scale output value*/
- short hFactor; /*horizontal scale output value*/
- short aSize; /*actual size of actual font used*/
- short tabSize; /*total size of table*/
- };
- typedef struct WidthTable WidthTable;
-
- struct FamRec {
- short ffFlags; /*flags for family*/
- short ffFamID; /*family ID number*/
- short ffFirstChar; /*ASCII code of 1st character*/
- short ffLastChar; /*ASCII code of last character*/
- short ffAscent; /*maximum ascent for 1pt font*/
- short ffDescent; /*maximum descent for 1pt font*/
- short ffLeading; /*maximum leading for 1pt font*/
- short ffWidMax; /*maximum widMax for 1pt font*/
- long ffWTabOff; /*offset to width table*/
- long ffKernOff; /*offset to kerning table*/
- long ffStylOff; /*offset to style mapping table*/
- short ffProperty[9]; /*style property info*/
- short ffIntl[2]; /*for international use*/
- short ffVersion; /*version number*/
- };
- typedef struct FamRec FamRec;
-
- typedef SInt16 FontPointSize;
- typedef SInt16 FontFamilyID;
- extern pascal void InitFonts(void )
- ONEWORDINLINE(0xA8FE);
-
- extern pascal void GetFontName(short familyID, Str255 name)
- ONEWORDINLINE(0xA8FF);
-
- extern pascal void GetFNum(ConstStr255Param name, short *familyID)
- ONEWORDINLINE(0xA900);
-
- extern pascal Boolean RealFont(short fontNum, short size)
- ONEWORDINLINE(0xA902);
-
- extern pascal void SetFontLock(Boolean lockFlag)
- ONEWORDINLINE(0xA903);
-
- extern pascal FMOutPtr FMSwapFont(const FMInput *inRec)
- ONEWORDINLINE(0xA901);
-
- extern pascal void SetFScaleDisable(Boolean fscaleDisable)
- ONEWORDINLINE(0xA834);
-
- extern pascal void FontMetrics(FMetricRecPtr theMetrics)
- ONEWORDINLINE(0xA835);
-
- extern pascal void SetFractEnable(Boolean fractEnable)
- ONEWORDINLINE(0xA814);
-
- extern pascal short GetDefFontSize(void )
- FIVEWORDINLINE(0x3EB8, 0x0BA8, 0x6604, 0x3EBC, 0x000C);
-
- extern pascal Boolean IsOutline(Point numer, Point denom)
- TWOWORDINLINE(0x7000, 0xA854);
-
- extern pascal void SetOutlinePreferred(Boolean outlinePreferred)
- TWOWORDINLINE(0x7001, 0xA854);
-
- extern pascal Boolean GetOutlinePreferred(void )
- TWOWORDINLINE(0x7009, 0xA854);
-
- extern pascal OSErr OutlineMetrics(short byteCount, const void *textPtr, Point numer, Point denom, short *yMax, short *yMin, FixedPtr awArray, FixedPtr lsbArray, RectPtr boundsArray)
- TWOWORDINLINE(0x7008, 0xA854);
-
- extern pascal void SetPreserveGlyph(Boolean preserveGlyph)
- TWOWORDINLINE(0x700A, 0xA854);
-
- extern pascal Boolean GetPreserveGlyph(void )
- TWOWORDINLINE(0x700B, 0xA854);
-
- extern pascal OSErr FlushFonts(void )
- TWOWORDINLINE(0x700C, 0xA854);
-
- #if CGLUESUPPORTED
- extern void getfnum(const char *theName, short *familyID);
-
- extern void getfontname(short familyID, char *theName);
-
- #endif
- extern pascal short GetSysFont(void)
- TWOWORDINLINE(0x3EB8, 0x0BA6);
-
- extern pascal short GetAppFont(void)
- TWOWORDINLINE(0x3EB8, 0x0984);
-
- #if FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE
- extern pascal void AntiTextSetApplicationAware(Boolean aware)
- TWOWORDINLINE(0x7024, 0xA854);
-
- extern pascal Boolean AntiTextGetApplicationAware(void )
- TWOWORDINLINE(0x7025, 0xA854);
-
- extern pascal void AntiTextSetEnabled(Boolean enabled)
- TWOWORDINLINE(0x7026, 0xA854);
-
- extern pascal Boolean AntiTextGetEnabled(void )
- TWOWORDINLINE(0x7027, 0xA854);
-
- extern pascal Boolean AntiTextIsAntiAliased(Point numer, Point denom)
- TWOWORDINLINE(0x7028, 0xA854);
-
- #endif
- #if FOR_SYSTEM8_COOPERATIVE
-
- enum {
- kSystemSpecialFont = 1,
- kApplicationSpecialFont = 2,
- kSmallSystemSpecialFont = 3,
- kEmphasisSpecialFont = 4,
- kKeyboardSymbolSpecialFont = 5,
- kCountSpecialFonts = kKeyboardSymbolSpecialFont
- };
-
- typedef UInt32 SpecialFontSelector;
- /* --------------------------------------------------------------*/
- typedef struct OpaqueTextStrikeRef* TextStrikeRef;
-
- enum {
- kDefaultTextStrike = 0,
- kAntiAliasTextStrike = 0x0001,
- kFractionalWidthsTextStrike = 0x0002,
- kPreserveGlyphTextStrike = 0x0004
- };
-
-
- enum {
- kPreserveTextStrikeElement = 0x8000 /* for QDSetStrikeElements */
- };
-
- typedef OptionBits TextStrikeOption;
- /* --------------------------------------------------------------*/
- extern TextStrikeRef QDNewStrike(void );
-
- extern void QDDisposeStrike(TextStrikeRef strike);
-
- extern TextStrikeRef QDCloneStrike(TextStrikeRef strike);
-
- extern TextStrikeRef QDCopyStrike(TextStrikeRef source);
-
- extern void QDReplaceStrike(TextStrikeRef destination, TextStrikeRef source);
-
- extern Boolean QDEqualStrike(TextStrikeRef strike1, TextStrikeRef strike2);
-
- extern ItemCount QDStrikeOwnerCount(TextStrikeRef strike);
-
- extern ByteCount QDFlattenStrike(TextStrikeRef strike, Byte stream[]);
-
- extern TextStrikeRef QDUnflattenStrike(TextStrikeRef strike, const Byte stream[], ByteCount *size);
-
- extern void QDGetStrikeElements(TextStrikeRef strike, short *familyID, short *styleBits, short *pointSize);
-
- extern void QDSetStrikeElements(TextStrikeRef strike, short familyID, short styleBits, short pointSize);
-
- extern TextStrikeOption QDGetStrikeOptions(TextStrikeRef strike);
-
- extern void QDSetStrikeOptions(TextStrikeRef strike, TextStrikeOption options);
-
- extern SpecialFontSelector QDGetStrikeSpecialFont(TextStrikeRef strike);
-
- extern void QDSetStrikeSpecialFont(TextStrikeRef strike, SpecialFontSelector selector);
-
- extern TextEncoding QDGetStrikeEncoding(TextStrikeRef strike);
-
- extern void QDSetStrikeEncoding(TextStrikeRef strike, TextEncoding encoding);
-
- extern ItemCount QDGetStrikeFeatures(TextStrikeRef strike, gxRunFeature features[]);
-
- extern void QDSetStrikeFeatures(TextStrikeRef strike, ItemCount count, const gxRunFeature features[]);
-
- extern ItemCount QDGetStrikeVariations(TextStrikeRef strike, gxFontVariation variations[]);
-
- extern void QDSetStrikeVariations(TextStrikeRef strike, ItemCount count, const gxFontVariation variations[]);
-
- extern gxMapping *QDGetStrikeMapping(TextStrikeRef strike, gxMapping *map);
-
- extern void QDSetStrikeMapping(TextStrikeRef strike, const gxMapping *map);
-
- extern TextStrikeRef QDGetPortStrike(CGrafPort *port);
-
- extern void QDSetPortStrike(CGrafPort *port, TextStrikeRef strike);
-
- extern ByteCount QDGetStrikeCustomItem(TextStrikeRef strike, OSType tag, BytePtr dataP);
-
- extern void QDSetStrikeCustomItem(TextStrikeRef strike, OSType tag, BytePtr dataP, ByteCount size);
-
- extern void QDSetStrikeColors(TextStrikeRef strike, RGBColor *foreColor, RGBColor *backColor);
-
- extern void QDGetStrikeColors(TextStrikeRef strike, RGBColor *foreColor, RGBColor *backColor);
-
- extern void QDSetStrikeTransferMode(TextStrikeRef strike, short textMode);
-
- extern short QDGetStrikeTransferMode(TextStrikeRef strike);
-
- /* --------------------------------------------------------------*/
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __FONTS__ */
-
-